<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "https://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-CN"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta http-equiv="Content-Language" content="zh-CN"><link href="stylesheet.css" media="all" rel="stylesheet" type="text/css">
<title>pg_roles</title>
<script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?d286c55b63a3c54a1e43d10d4c203e75"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script>
</head><body class="SECT1">
<div>
<table summary="Header navigation table" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><th colspan="5" align="center" valign="bottom">PostgreSQL 8.2.3 中文文档</th></tr>
<tr><td width="10%" align="left" valign="top"><a href="view-pg-prepared-xacts.html" accesskey="P">后退</a></td><td width="10%" align="left" valign="top"><a href="catalogs.html">快退</a></td><td width="60%" align="center" valign="bottom">章43. 系统表</td><td width="10%" align="right" valign="top"><a href="catalogs.html">快进</a></td><td width="10%" align="right" valign="top"><a href="view-pg-rules.html" accesskey="N">前进</a></td></tr>
</table>
<hr align="LEFT" width="100%"></div>
<div class="SECT1"><h1 class="SECT1"><a name="VIEW-PG-ROLES">43.42. <tt class="STRUCTNAME">pg_roles</tt></a></h1><a name="AEN65924"></a>
<p><tt class="STRUCTNAME">pg_roles</tt> 提供访问数据库角色有关信息的接口。它只是一个 <a href="catalog-pg-authid.html"><tt class="STRUCTNAME">pg_authid</tt></a> 表的公开可读部分的视图，把口令字段用空白填充了。</p>
<p>该视图明确的显示了底层表的 OID 字段，可以用于与其它表连接。</p>
<div class="TABLE"><a name="AEN65931"></a>
<p><b>表43-42. <tt class="STRUCTNAME">pg_roles</tt> 字段</b></p>
<table border="1" class="CALSTABLE"><col><col><col><col>
<thead>
<tr><th>名字</th><th>类型</th><th>引用</th><th>描述</th></tr>
</thead>
<tbody>
<tr><td><tt class="STRUCTFIELD">rolname</tt></td><td><tt class="TYPE">name</tt></td><td>&nbsp;</td><td>角色名</td></tr>
<tr><td><tt class="STRUCTFIELD">rolsuper</tt></td><td><tt class="TYPE">bool</tt></td><td>&nbsp;</td><td>有超级用户权限的角色</td></tr>
<tr><td><tt class="STRUCTFIELD">rolinherit</tt></td><td><tt class="TYPE">bool</tt></td><td>&nbsp;</td><td>自动继承属主角色权限的角色</td></tr>
<tr><td><tt class="STRUCTFIELD">rolcreaterole</tt></td><td><tt class="TYPE">bool</tt></td><td>&nbsp;</td><td>可以创建更多角色的角色</td></tr>
<tr><td><tt class="STRUCTFIELD">rolcreatedb</tt></td><td><tt class="TYPE">bool</tt></td><td>&nbsp;</td><td>可以创建数据库的角色</td></tr>
<tr><td><tt class="STRUCTFIELD">rolcatupdate</tt></td><td><tt class="TYPE">bool</tt></td><td>&nbsp;</td><td>可以直接更新系统表的角色。除非这个字段为真，否则超级用户也不能干这个事情。</td></tr>
<tr><td><tt class="STRUCTFIELD">rolcanlogin</tt></td><td><tt class="TYPE">bool</tt></td><td>&nbsp;</td><td>可以登录的角色，也就是说，这个角色可以给予初始化会话认证的标识符。</td></tr>
<tr><td><tt class="STRUCTFIELD">rolconnlimit</tt></td><td><tt class="TYPE">int4</tt></td><td>&nbsp;</td><td>对于可以登录的角色，这儿限制了该角色允许发起的最大并发连接数。 -1 表示无限制。</td></tr>
<tr><td><tt class="STRUCTFIELD">rolpassword</tt></td><td><tt class="TYPE">text</tt></td><td>&nbsp;</td><td>不是口令(总是 <tt class="LITERAL">********</tt>)</td></tr>
<tr><td><tt class="STRUCTFIELD">rolvaliduntil</tt></td><td><tt class="TYPE">timestamptz</tt></td><td>&nbsp;</td><td>口令失效日期(只用于口令认证)；如果没有失效期，为 NULL</td></tr>
<tr><td><tt class="STRUCTFIELD">rolconfig</tt></td><td><tt class="TYPE">text[]</tt></td><td>&nbsp;</td><td>运行时配置变量的会话缺省</td></tr>
<tr><td><tt class="STRUCTFIELD">oid</tt></td><td><tt class="TYPE">oid</tt></td><td><tt class="LITERAL"><a href="catalog-pg-authid.html"><tt class="STRUCTNAME">pg_authid</tt></a>.oid</tt></td><td>角色的 ID</td></tr>
</tbody>
</table>
</div>
</div>
<div>
<hr align="LEFT" width="100%">
<table summary="Footer navigation table" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td width="33%" align="left" valign="top"><a href="view-pg-prepared-xacts.html" accesskey="P">后退</a></td><td width="34%" align="center" valign="top"><a href="index.html" accesskey="H">首页</a></td><td width="33%" align="right" valign="top"><a href="view-pg-rules.html" accesskey="N">前进</a></td></tr>
<tr><td width="33%" align="left" valign="top"><tt class="STRUCTNAME">pg_prepared_xacts</tt></td><td width="34%" align="center" valign="top"><a href="catalogs.html" accesskey="U">上一级</a></td><td width="33%" align="right" valign="top"><tt class="STRUCTNAME">pg_rules</tt></td></tr>
</table>
</div>
</body></html>